<?php
/**
 * Created by PhpStorm.
 * User: dell
 * Date: 2017/12/21
 * Time: 17:28
 */
namespace AcoManager\Model\Table;
use Cake\ORM\Table;
use Cake\ORM\RulesChecker;

class AdminAcosTable extends Table
{
    public function initialize(array $config)
    {
        $this->addBehavior('Tree');
    }

    public function buildRules(RulesChecker $rules)
    {
        $rules->add($rules->isUnique(['alias'],'hasonething'),'hasone',array(
            'errorField' => 'Alias',
            'message' => 'Alias is be Unique.'
        ));
        return $rules;
    }
}